<template>
  <div class="box" :style="{ background: bg1 }">ddd</div>
</template>

<script>
export default {
  inject: ["bg1","bg2"],
  watch: {
    bg1(newVal,oldVal) {

        console.log(newVal,oldVal);
    },
  },
  mounted() {
    console.log(this.bg1);
  },
};
</script>

<style>
.box {
  height: 100px;
}
</style>